import routes from '../router/children'



export const addMenus = (parentName, router, role) => {
    routes.filter(route => {
        if (role == 'admin' && role == route.meta.role) return true
        else if (role !== 'admin' && route.meta.role !== 'admin') return true
        else return false;
    }).forEach(route => {
        return router.addRoute(parentName, route)
    }
    )
}